package com.lianbang.staff.http.api

import cn.ubest.mvvmcore.bean.ResultWrapper
import cn.ubest.mvvmcore.bean.Wrapper
import com.lianbang.staff.bean.CheckCodeBean
import com.lianbang.staff.bean.UserBean
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.POST

/**
 * Created by maoqi on 2021/1/13.
 */
interface UserApi {
    //登录
    @FormUrlEncoded
    @POST("login/login")
    suspend fun login(
        @Field("account") account: String,
        @Field("pwd") pwd: String
    ): ResultWrapper<UserBean>

    //修改密码
    @FormUrlEncoded
    @POST("salesman_api/edit_userpwd")
    suspend fun changePassword(
        @Field("oldpwd") oldpwd: String,
        @Field("newpwd") newpwd: String,
        @Field("confirmpwd") confirmpwd: String
    ): Wrapper

    //找回密码
    @FormUrlEncoded
    @POST("login/find_pwd")
    suspend fun findPassword(
        @Field("mobile") mobile: String,
        @Field("code") code: String,
        @Field("newpwd") newPwd: String,
        @Field("confirmpwd") confirmPwd: String
    ): Wrapper

    //校验验证码
    @FormUrlEncoded
    @POST("login/find_pwd_valid")
    suspend fun checkFindPasswordCode(
        @Field("mobile") mobile: String,
        @Field("code") code: String
    ): ResultWrapper<CheckCodeBean>

    //发送验证码
    @FormUrlEncoded
    @POST("public/send_code")
    suspend fun sendCode(
        @Field("mobile") mobile: String,
        @Field("sms_auth") sms_auth: String,
        @Field("type") type: String
    ): Wrapper

}